﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace BingVis.SilverlightClient.Common
{
    public class DoneProcessingEventArgs : EventArgs
    {
        public int NumProcessed { get; set; }
        public bool HadErrors { get; set; }
        public object Result { get; set; }

        public DoneProcessingEventArgs(int numP, bool hadError, object result)
        {
            NumProcessed = numP;
            HadErrors = hadError;
            Result = result;
        }
    }

    public delegate void ItemLoadedEvent<T>(object sender, LoadedEventArgs<T> args);
    public delegate void DoneProcessingEvent(object sender, DoneProcessingEventArgs args);

    public interface ILoader<T>    
    {
        bool Processing { get; }
        List<T> Items { get; }
        void StopProcessing();
        void ProcessFile();
        void ProcessItem(ICSVLine line);
        event ItemLoadedEvent<T> ItemLoaded;
        event DoneProcessingEvent DoneProcessing;
    }
}
